package autosimmune.agents.styles;

import java.awt.Color;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;

import repast.simphony.visualization.visualization2D.style.Style2D;
import autosimmune.agents.Antibody;
import edu.umd.cs.piccolo.PNode;
import edu.umd.cs.piccolo.nodes.PPath;
import edu.umd.cs.piccolo.nodes.PText;

public class AntibodyStyle2D implements Style2D<Antibody> {

private Rectangle2D rect;
	
	public AntibodyStyle2D(){
		rect = new Rectangle2D.Float(0, 0, 5,5);
	}
	
	@Override
	public Rectangle2D getBounds(Antibody object) {
		return rect;
	}

	@Override
	public PText getLabel(Antibody object) {
		return null;
	}

	@Override
	public PNode getPNode(Antibody obj, PNode node) {
		Shape s = new Ellipse2D.Float(0, 0, 5, 5);
		PPath path = new PPath(s);
		path.setBounds(rect);
		path.setPaint(this.getPaint(obj));
		path.setStroke(this.getStroke(obj));
		path.setStrokePaint(this.getStrokePaint(obj));
		return path;
	}

	@Override
	public Paint getPaint(Antibody object) {

		if(object.gotVirus()){
			return Color.GREEN;
		} else {
			return Color.MAGENTA;
		}
		
	}

	@Override
	public double getRotation(Antibody object) {
		return 0;
	}

	@Override
	public Stroke getStroke(Antibody object) {
		return null;
	}

	@Override
	public Paint getStrokePaint(Antibody object) {
		return Color.BLACK;
	}

	@Override
	public boolean isScaled(Antibody object) {
		return true;
	}

}
